On-chip resistor divider compensation with a 2Vrms input

ABSTRACT

A new compensation system for an audio input reduces noise by matching feedback ratios in the positive and negative paths. A variable resistance network allows for fine control of resistance trimming in one of the signal paths, which allows for compensation between tolerance of resistors that are external to an integrated circuit and those that are internal to the integrated circuit.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims benefit of U.S. Provisional Application61/842,867, filed Jul. 3, 2013, entitled ON-CHIP RESISTOR DIVIDERCOMPENSATION WITH A 2VRMS INPUT, which is incorporated by referenceherein.

FIELD OF THE INVENTION

This disclosure is directed to audio inputs, and, more specifically, toa system that compensates a conversion circuit that adjusts a firstnominal input voltage to a second nominal input voltage.

BACKGROUND

Typical audio sources such as from a CD player, audio amplifier, ormixer generally produce line outputs in the 2Vrms range. Modernintegrated circuits built with modern low-voltage processes, however,cannot handle the full range of a 2Vrms signal, so the input signal mustbe reduced. This is typically done by dividing the input signal prior tothe input voltage signal being applied to the integrated circuit forsound processing.

It is beneficial to have a fully differential input to take advantage ofthe common mode rejection. The negative terminal is a low impedanceground sense path. Using an external resistor divider causes a mismatchbetween the external ground to each input of the signal processing chip,which will introduce noise.

Embodiments of the invention address these and other limitations of theprior art.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a circuit diagram illustrating a conventional resistordivider.

FIG. 2 is a Thevenin equivalent diagram of the resistor dividerillustrated in FIG. 1.

FIG. 3 is a circuit diagram of a Thevenin equivalent of an input dividerincluding a compensation function according to embodiments of theinvention.

FIG. 4 is a circuit diagram of a pre-amplification circuit including aresistance compensation circuit according to embodiments of theinvention.

FIG. 5A is a schematic diagram of an example compensation circuitaccording to an embodiment of the invention.

FIG. 5B is a schematic diagram of an example compensation circuitaccording to another embodiment of the invention.

FIG. 6A is a schematic diagram of an example compensation circuitaccording to embodiments of the invention.

FIG. 6B is a schematic diagram of a compensation controller for use withthe compensation circuit illustrated in FIG. 6A.

FIG. 7 is a circuit diagram illustrating a two-channel resistor dividerproviding input for a two-channel pre-amplification circuit according tofurther embodiments of the invention.

FIG. 8 is a block diagram of a CODEC including a pre-amplifier havinginput compensation according to embodiments of the invention.

DETAILED DESCRIPTION

Embodiments of the invention are directed to an input compensationsystem, such as for a preamplifier of a coder-decoder (CODEC), thatcompensates for noise presented on common mode inputs, such as noise onthe ground plane and noise on the common mode reference voltage. Withoutsuch compensation, the system has a significant common mode noisecomponent. Much of the noise, however, may be eliminated by usingembodiments of the invention, which compensates for mismatch in thefeedback gains of the signal path and ground sense path.

It is beneficial to use a fully differential input to take advantage ofthe common mode rejection. As mentioned above, a 2 Vrms input signal isconventionally divided using a resistor divider, such as illustrated inFIG. 1, to provide a 1 Vrms level for an on-chip pre-amplifier or otherinput circuit. In FIG. 1, components to the right of the vertical dottedline are formed within an integrated circuit (IC), such as a CODEC orother audio component, while components to the left of the vertical lineare external to the sound processing IC.

In FIG. 1 an audio signal 6 is supplied between a ground sense node 2and an audio input node 4. A ground sense path is the path between theground sense node 2, through an operational amplifier 10 to an outputV_(OUT)+. Similarly, a signal path is the path between the signal node4, through the operational amplifier 10 to an output V_(OUT−).

The resistors in the resistor divider circuit formed by RB₁, RB₂ arechosen in conjunction with the internal resistor network (RS₁, RS₂, RF₁,RF₂) to not disturb the total gain of the signal path. The equivalentresistance of the resistor divider is considered as part of the inputresistor when considering the gain, as illustrated in FIG. 2.

As illustrated in FIG. 2, which is the Thevenin equivalent diagram ofthe circuit in FIG. 1, resistances in the signal path no longer matchresistances in the ground sense path because of the presence of theresistor divider circuit. This mismatch introduces noise. The Theveninequivalent of the external network RB₁, RB₂ illustrated in FIG. 2, is asfollows:

$v_{t\; h} = {{v_{s}\frac{R_{B\; 2}}{R_{B\; 1} + R_{B\; 2}}R_{T\; H}} = {R_{B\; 1} \parallel R_{B\; 2}}}$

Feedback ratios for the signal path and ground sense path can becalculated as follows:

$\beta_{1} = {{\frac{R_{S\; 1} + R_{T\; H}}{R_{S\; 1} + R_{T\; H} + R_{F\; 1}}\beta_{2}} = \frac{R_{S\; 2}}{R_{S\; 2} + R_{F\; 2}}}$

The transfer function from common mode inputs to an output of theoperational amplifier 10 as a function of the feedback ratios is definedas:

$\frac{v_{OUT}}{\left( {v_{OCM} - v_{i\; c}} \right)} = \frac{2 \cdot \left( {\beta_{1} - \beta_{2}} \right)}{\beta_{1} + \beta_{2}}$

With no adjustments: (R_(S1)=R_(S2),R_(F1)=R_(F2) (β₁≠β₂)), the feedbackratios do not cancel out and a significant signal from the common modeinputs to the output exists:

$\frac{v_{OUT}}{\left( {v_{OCM} - v_{i\; c}} \right)} = \frac{1}{{\frac{R_{S}}{R_{F}}\frac{\left( {R_{S} + R_{T\; H} + R_{F}} \right)}{R_{T\; H}}} + 1}$

For better common mode rejection, it is best to match β1=β2 as closelyas possible.R _(S) ₁ =R _(S)R _(F) ₁ =R _(F)R _(S) ₂ =R _(S) +R _(X)R _(F) ₂ =R _(F)

Where R_(S2) is skewed by the Thevenin equivalent resistance so that thetwo paths match (R_(X)=R_(TH)). With this shift, β₁ and β₂ closely matchand the common mode signal can be canceled.

Although external resistors generally have 1% precision, on-chipresistors are typically formed of polysilicon and may have up to +/−20%variation in their resistance values. This variation limits the abilityto match β1 and β2 as closely as desired. Not being able to closelymatch the desired resistance values, due to the processing variations inmaking polysilicon resistors, as set forth above, increases noise fromthe common mode inputs.

Still with reference to FIG. 2, the resistance value of R_(S2) will varywith the polysilicon process by ±20%, because R_(S2) is located on theIC. Conversely, the resistance value of R_(TH), which is located off theIC, will vary only by approximately 1%. This will skew the feedbackratios as follows:

$\beta_{1\;\Delta} = \frac{{R_{S\;}\left( {1 + \Delta_{ply}} \right)} + R_{T\; H}}{{R_{S\;}\left( {1 + \Delta_{ply}} \right)} + R_{T\; H} + {R_{F\;}\left( {1 + \Delta_{ply}} \right)}}$

$\beta_{2\;\Delta} = \frac{{R_{S\;}\left( {1 + \Delta_{ply}} \right)} + {R_{X}\left( {1 + \Delta_{ply}} \right)}}{{R_{S\;}\left( {1 + \Delta_{ply}} \right)} + {R_{X}\left( {1 + \Delta_{ply}} \right)} + {R_{F\;}\left( {1 + \Delta_{ply}} \right)}}$

$\beta_{1\;\Delta} = \frac{R_{S\;}\frac{R_{T\; H}}{1 + \Delta_{ply}}}{R_{S\;} + \frac{R_{T\; H}}{1 + \Delta_{ply}} + R_{F}}$

$\beta_{2\;\Delta} = \frac{R_{S} + R_{X}}{R_{S} + R_{X} + R_{F}}$

To compensate for this mismatch, embodiments of the invention skew theinternal ground sense path with a fine resistor trim, which is performedwithin a compensation circuit 120 located within the ground sense path.The compensation circuit 120 may be used to account for the +/−20%variation in polysilicon resistance that occurs when producing the IC.The variation of polysilicon resistance can be determined by an on-chipprocess monitor, as described in detail below.

FIG. 4 is a circuit diagram of a pre-amplification circuit in an on-chippreamplifier 104 including a compensation circuit according toembodiments of the invention. In comparison with the conventionalamplifier illustrated in FIG. 1, embodiments of the invention include acontrollable compensation circuit 220. The compensation circuit 220 mayhave three terminals, an input terminal 221 coupled to a low impedanceground sense node 202, a central terminal 222 coupled to an invertinginput 212 of an operational amplifier 210, and an output terminal 226coupled to a non-inverting output 216 of the operational amplifier 210.

The compensation circuit 220 is controlled by a control 225 to vary anamount of resistance between the three nodes 221, 222, and 226. Inpractice, after measuring a resistance value on the IC, such as, forexample, measuring a control polysilicon resistor on the IC, the control225 may be set to compensate for the variation by adjusting an amount ofresistance provided at the three nodes 221, 222, and 226. This has thedesired effect of balancing values such that β_(1A)=β_(2A), reducing thenoise in the preamplifier 104.

FIGS. 5A and 5B are schematic diagrams of example controllable resistorcircuits that may be used in compensation circuits according to anembodiment of the invention.

The controllable resistor circuit illustrated in FIG. 5A includes aresistance R_(F2) coupled between nodes 2 and 3, and includes aresistance R_(S2) coupled between nodes 1 and 2. Further includedbetween nodes 1 and 2 is a controllable resistor R_(X), which iscontrollable in the sense that its resistance value can be changed.Changing the resistor value R_(X) changes the resistance values betweennodes 1 and 2 as well as between nodes 2 and 3 of the controllableresistor circuit illustrated in FIG. 5A. This embodiment of theresistance circuit is the one used for the calculations set forth abovefor matching β1 and β2.

In operation, using embodiments of the invention as illustrated in FIG.5A, the resistance R_(X) is adjusted inversely in proportion to themeasured polysilicon resistance variation to match β_(1A)=β_(2A).

$R_{X} = \frac{R_{T\; H}}{1 + \Delta_{{ply}\;\_\;{meas}}}$

The controllable resistor circuit illustrated in FIG. 5B uses a variableresistor R_(Y) between resistances R_(S2)-R_(Y) and R_(F2)-R_(Y). As theresistor R_(Y) is changed, so necessarily do the resistancesR_(S2)-R_(Y) and R_(F2)-R_(Y) change. Controlling the resistance ofresistor R_(Y) may be thought of as controlling a wiper on a mechanicalvariable resistor coupled between nodes 1 and 3.

The resistance R_(Y) may be related to the resistance R_(X) describedabove by the following linear transformation:β₂ _(X) β₂ _(Y)

$\frac{R_{S} + R_{S}}{R_{S} + R_{X} + R_{F}} = \frac{R_{S} + R_{Y}}{R_{S} + R_{Y} + R_{F} - R_{Y}}$

${R_{Y} = \frac{R_{X}R_{F}}{R_{S} + R_{F} + R_{X}}},$where R_(X)=R_(TH)

In operation, using embodiments of the invention as illustrated in FIG.5B, the resistance R_(Y) is adjusted inversely in proportion to themeasured polysilicon resistance variation to match β_(1A)=β_(2A).

${R_{Y} = \frac{R_{X}R_{F}}{R_{S} + R_{F} + R_{X}}},{where}$$R_{X} = \frac{R_{T\; H}}{1 + \Delta_{{ply}\;\_\;{meas}}}$

FIG. 6A is a circuit diagram illustrating an example embodiment of thecompensation circuit 320 of FIG. 4 that uses the resistance circuitillustrated in FIG. 5B, according to embodiments of the invention. Thecompensation circuit 320 may be an example of the compensation circuit220 of FIG. 4, for instance.

In the compensation circuit 320 of FIG. 6A, a series of resistors R₀-R₂^(n) are coupled between nodes 321 and 326. Then, a series ofcontrollable switches S₀-S₂ ^(n) ⁻¹ couples a selectable number of theseries of resistors between the nodes 321 and 322. Controlling theseries of controllable switches S₀-S₂ ^(n) ⁻¹ may be thought of ascontrolling a wiper on a mechanical variable resistor.

The series of controllable switches S₀-S₂ ^(n) ⁻¹ in FIG. 6A may becontrolled by a control circuit, such as a control circuit 340illustrated in FIG. 6B. In this embodiment, the control circuit 340 isembodied by an n-to-2^(n) decoder that operates conventionally. Forexample, in a four-input decoder, an input from the four inputs isdecoded to select exactly one of sixteen outputs. The selected outputthen causes its respective switch to which it is coupled to close,thereby changing the ratios of resistance between the three nodes 321,322, 326. In some embodiments of the invention, each one of the outputsfrom the decoder is coupled to a unique switch controller, asillustrated in FIG. 6A. Each switch is coupled between two adjacentresistors. In some embodiments of the invention the resistance of theresistors in the compensation circuit may be identical, while in othersthey may be non-identical. Further, a number of separate resistors inR₀-R₂ ^(n) used to successfully compensate for the mismatch may becalculated based on the percentage variation in resistance, e.g.,+/−20%, as well as the what the level of common mode rejection isdesired. In some embodiments the number of switches S₀-S₂ ^(n) ⁻¹ maybe, for example, as few as 4, and as many as 16, and preferably between8 and 16. Embodiments of the invention work in the same manner no matterthe number of separate switches are used. Also, FIG. 6A illustrates onemore resistor than switch, but such details are likely implementationspecific.

In operation, with reference to FIGS. 6A, 6B, and 3, for instance, ifthe output of the decoder 340 is “S₂”, then the switch controlled by thesignal S₂ connects node 221 to node 222 through exactly 3 resistors. Ifinstead the decoder output were S₁, then the switch controlled by thesignal S₁ would connect the nodes 221 and 222 together through exactly 2resistors, and specifically R₀, R₁, and R₂. Note that the nodes 221 and226 are coupled through the same number of resistors R₀-R₂ ^(n)regardless of which switch is selected in the compensation circuit 340.Thus, with reference back to FIGS. 5B and 3, the resistance R_(Y), iscontrollable, which effectively allows control of the amount ofresistance supplied to the inverting input 112 of the operationalamplifier 110. Controlling this path effectively compensates for anyinput signal mismatch by adjusting the feedback ratio β2 to match thatof β1.

In some embodiments the controller 340 may be set to automaticallyselect a middle value of resistance as a starting point. For example, ifthe production process yields target polysilicon resistance values, thenno further “fine-tuning” control may be necessary for inputcompensation.

Determining which of the controllable switches S₀-S₂ ^(n) ⁻¹ to operatein FIG. 5A is based on a resistance mismatch between resistance valuesinside the IC and resistance values outside the IC. For example, apolysilicon resistor internal to the IC may be formed having a targetresistance value that exactly matches a resistance value of a resistoroutside of the IC. One example uses 64 KOhm resistor values for both theinternal and external resistor. Then a constant current, for example aconstant reference current from the bandgap is driven through both theinternal and external resistors. A voltage is measured on each of thecurrent paths through the internal and external resistors, and themeasured voltages are compared to one another. The ratio of comparedvoltages is directly proportional to the difference in resistor valuesbetween the internal and external resistances. This relationship is thenused to determine how to skew the resistances within the compensationcircuit in the ground sense path so that gains in the ground sense pathmatch those in the signal path.

An additional calibration method includes injecting a supersonic(i.e., >20 KHz) signal into the common mode reference voltage V_(OCM).If the circuit is matched, i.e., the internal and external resistors arein their proper relationships to one another, without variation from theintended resistance values, then the injected signal is attenuated bythe common mode rejection. If, however, there is any mismatch betweenthe gain of the signal path and the gain of the ground sense path, thena residual signal from the injected signal will appear in the outputsignals V_(OUT−) and V_(OUT+). Then, the residual signal may be isolatedfrom other signals on the output signals using digital sound processing.Finally, the resistance values of the compensation circuit may betrimmed, using techniques described above, to shift the resistancevalues between the nodes coupled to the compensation circuit. Inparticular, the resistance values in the compensation circuit areadjusted until the residual signal in the output signals V_(OUT−) andV_(OUT+), is minimized This method of calibration is attractive because,since the tone is supersonic, i.e, above the threshold of human hearing,the calibration may run continuously or periodically in the backgroundand never be heard by the user. Additionally, since the calibrationtakes place while the pre-amplifier circuit is operational, it does notrequire an additional setup step to perform the calibration.

Other embodiments may use other methods of controlling the resistancebetween the nodes 321, 322, 326.

FIG. 7 is a circuit diagram illustrating a two-channel resistor divider,on which embodiments of the invention may be applied. This embodimentincludes two operational amplifiers 410, 430, each of which may be usedfor a separate channel, for example a left channel and a right channelof a stereo preamplifier. Compensation circuits 420, 450 may be coupledin the same way as the single channel embodiment illustrated in FIG. 4.Such an embodiment as illustrated in FIG. 7 allows each channel of atwo-input pre-amplifier to be separately controlled to minimize inputnoise. A further embodiment, not illustrated, reduces crosstalk betweenthe two channels, i.e., between the right and left channels. Theembodiment includes providing an additional capacitor, so that each ofthe two RS₂ resistors in FIG. 7 includes a capacitor between it and theground sense node. This reduces cross talk between the two channels thatoccurs when sharing the ground sense capacitor, and further reducesnoise in the system.

FIG. 8 is a functional block diagram of an example CODEC IC 500incorporating embodiments of the invention. A resistor divider 502 islocated off chip from the CODEC IC 500, and provides an audio inputsignal to the CODEC. The input signal is received by a preamplifier 510that includes an input compensator 515. The input compensator 515functions as those described above to limit noise caused by the mismatchintroduced from the external divider.

The preamplifier 510 passes the reduced-noise input to an internalcomponent, such as an Analog to Digital Converter (ADC) to convert theanalog input signal to a digital audio signal. A sound processor such asa Digital Signal Processor (DSP) 530 may perform varied effects on thedigital audio signal, such as noise reduction, equalization, balance, orother enhancements. An output of the DSP 530 may be provided as adigital signal output 532 of the CODEC IC 500.

Depending on the type of CODEC IC 500, outputs from the DSP 530 may alsobe coupled to Digital to Analog converters 540, 560 to convert theprocessed signals back to audio analog signals. These signals may beprovided to, for example, a headphone amplifier 550 coupled to aheadphone jack, or to a PWM processor 570 for providing an amplifiedoutput to drive speakers.

Embodiments of the invention may be incorporated into integratedcircuits such as sound processing circuits, or other audio circuitry. Inturn, the integrated circuits may be used in audio devices such as soundbars, audio docks, amplifiers, speakers, etc.

Having described and illustrated the principles of the invention withreference to illustrated embodiments, it will be recognized that theillustrated embodiments may be modified in arrangement and detailwithout departing from such principles, and may be combined in anydesired manner. And although the foregoing discussion has focused onparticular embodiments, other configurations are contemplated.

In particular, even though expressions such as “according to anembodiment of the invention” or the like are used herein, these phrasesare meant to generally reference embodiment possibilities, and are notintended to limit the invention to particular embodiment configurations.As used herein, these terms may reference the same or differentembodiments that are combinable into other embodiments.

Consequently, in view of the wide variety of permutations to theembodiments described herein, this detailed description and accompanyingmaterial is intended to be illustrative only, and should not be taken aslimiting the scope of the invention.

The invention claimed is:
 1. An audio preamplifier having a ground senseinput and a signal input for receiving an analog audio input signal, theaudio preamplifier comprising: an operational amplifier having aninverting input and a non-inverting output; and a controller,comprising: a first resistance coupled between the ground sense inputand the inverting input of the operational amplifier; and a secondresistance coupled between the inverting input of the operationalamplifier and the non-inverting output of the operational amplifier,wherein the controller is structured to vary a resistance ratio betweenthe first resistance and the second resistance, the controller furthercomprising: a first node coupled to the ground sense input; a secondnode coupled to the inverting input of the operational amplifier, athird node coupled to the non-inverting output of the operationalamplifier; a plurality of resistors coupled between the first node andthe third node; and a plurality of controllable switches each having afirst node respectively coupled between a pair of adjacent resistors ofthe plurality of resistors, and each having a second node coupled to theinverting input of the operational amplifier.
 2. The audio preamplifierof claim 1, further comprising: a control circuit coupled to theplurality of controllable switches and structured to engage one of theplurality of controllable switches.
 3. The audio preamplifier of claim 2in which the control circuit is structured to engage a particular one ofthe plurality of controllable switches as a default state.
 4. An audiopreamplifier having a ground sense input and a signal input forreceiving an analog audio input signal, in which the signal input forreceiving an analog audio input signal is a first signal input forreceiving a first analog audio input signal, the audio preamplifiercomprising: an operational amplifier having an inverting input and anon-inverting output; a controller, comprising: a first resistancecoupled between the ground sense input and the inverting input of theoperational amplifier; and a second resistance coupled between theinverting input of the operational amplifier and the non-invertingoutput of the operational amplifier, wherein the controller isstructured to vary a resistance ratio between the first resistance andthe second resistance; a second signal input for receiving a secondanalog audio input signal; a second operational amplifier having aninverting input and a non-inverting output; and a second controllercoupled to the inverting input and the non-inverting output of thesecond operational output and structured to vary a resistance value. 5.An audio CODEC comprising: an audio preamplifier having a ground senseinput and a signal input for receiving an analog audio input signal, theaudio preamplifier including: an operational amplifier having aninverting input and a non-inverting output; and a controller,comprising: a first resistance coupled between the ground sense inputand the inverting input of the operational amplifier; and a secondresistance coupled between the inverting input of the operationalamplifier and the non-inverting output of the operational amplifier,wherein the controller is structured to vary a resistance ratio betweenthe first resistance and the second resistance, the controller furthercomprising: a first node coupled to the ground sense input; a secondnode coupled to the inverting input of the operational amplifier, athird node coupled to the non-inverting output of the operationalamplifier, a plurality of resistors coupled between the first node andthe third node; and a plurality of controllable switches each having afirst node respectively coupled between a pair of adjacent resistors ofthe plurality of resistors, and each having a second node coupled to theinverting input of the operational amplifier, and an Analog to DigitalConverter (ADC) configured to receive an analog output signal from theaudio preamplifier and convert the analog output signal to a digitaloutput signal.
 6. The audio CODEC of claim 5, further comprising: acontrol circuit coupled to the plurality of controllable switches andstructured to engage one of the plurality of controllable switches. 7.The audio CODEC of claim 6 in which the control circuit is structured toengage a particular one of the plurality of controllable switches as adefault state.
 8. An audio CODEC comprising an audio preamplifier and anAnalog to Digital Converter (ADC) configured to convert an analog outputsignal from the audio preamplifier to a digital output signal, the audiopreamplifier having a ground sense input and a signal input forreceiving an analog audio input signal, in which the signal input forreceiving an analog audio input signal is a first signal input forreceiving a first analog audio input signal, the audio preamplifiercomprising: an operational amplifier having an inverting input and anon-inverting output; and a controller, comprising: a first resistancecoupled between the ground sense input and the inverting input of theoperational amplifier, and a second resistance coupled between theinverting input of the operational amplifier and the non-invertingoutput of the operational amplifier, wherein the controller isstructured to vary a resistance ratio between the first resistance andthe second resistance; a second signal input for receiving a secondanalog input signal; a second operational amplifier having an invertinginput and a non-inverting output; and a second controller coupled to theinverting input and the non-inverting output of the second operationaloutput and structured to vary a resistance value.
 9. A method ofreducing noise in a preamplifier system in an integrated circuit, thepreamplifier system having a ground sense input coupled to a groundsense path and a signal input for receiving an analog audio inputsignal, the method comprising: measuring a first resistance value of aninternal resistor formed in the integrated circuit; measuring a secondresistance value of an external resistor formed outside the integratedcircuit; comparing the first resistance value to the second resistancevalue; and modifying a resistance ratio within a compensation network inthe ground sense path of the preamplifier system based on thecomparison, in which the compensation network includes a first nodecoupled to the ground sense input, a second node coupled to an invertinginput of an operational amplifier, and a third node coupled to anon-inverting output of the operational amplifier, and wherein modifyinga resistance ratio within a compensation network in the ground sensepath comprises setting a resistance ratio of a first resistance valuecoupled between the first and second nodes of the compensation networkto a second resistance value coupled between the second and third nodesof the compensation network, and further in which setting a resistanceratio of the first resistance value to the second resistance valuecomprises setting a controllable switch.
 10. The method of reducingnoise in a preamplifier system according to claim 9, in which setting acontrollable switch comprises setting one of a plurality of controllableswitches.
 11. The method of reducing noise in a preamplifier systemaccording to claim 10, in which setting one of a plurality ofcontrollable switches comprises operating a binary decoder.
 12. Themethod of reducing noise in a preamplifier system according to claim 9in which the internal resistor and the external resistor are selected tohave the same resistance values.
 13. The audio CODEC of claim 5, furthercomprising: a Digital Signal Processor (DSP) configured to receive thedigital output signal from the ADC and perform at least one of thefollowing on the digital output signal: noise reduction, equalization,and balance.
 14. The audio CODEC of claim 13, further comprising: aDigital to Analog Converter (DAC) configured to receive a digital outputsignal from the DSP and convert the digital output signal to an analogoutput signal.
 15. The audio CODEC of claim 14, further comprising: aheadphone amplifier configured to receive the analog output signal fromthe DAC and provide an amplified output audio signal to a headphonejack.
 16. The audio CODEC of claim 14, further comprising: a PWMprocessor configured to receive the analog output signal from the DACand provide an amplified output audio signal to at least one speaker.17. The audio CODEC of claim 8, further comprising: a Digital SignalProcessor (DSP) configured to receive the digital output signal from theADC and perform at least one of the following on the digital outputsignal: noise reduction, equalization, and balance.
 18. The audio CODECof claim 17, further comprising: a Digital to Analog Converter (DAC)configured to receive a digital output signal from the DSP and convertthe digital output signal to an analog output signal.
 19. The audioCODEC of claim 18, further comprising: a headphone amplifier configuredto receive the analog output signal from the DAC and provide anamplified output audio signal to a headphone jack.
 20. The audio CODECof claim 18, further comprising: a PWM processor configured to receivethe analog output signal from the DAC and provide an amplified outputaudio signal to at least one speaker.